SG Window | Window Object |
Create Method |
Properties Methods Events Constants Error Codes |
Creates new window.
object.Create(className As String, windowText As String, style As WinStyle, styleEx As WinStyleEx, x As Long, y As Long, width As Long, height As Long, hwndParent As Long, menuOrID As Long)
Part | Description |
object | The object is expression that evaluates to Window object |
className | Name of the window class. className can be one of the predefined Win32 class names or it can be a string returned from RegisterClass method. |
windowText | Window text. |
style | Window style. Can be combination of style constants defined in the WinStyle enumeration |
styleEx | Window extended style. Can be combination of style constants defined in the WinStyleEx enumeration |
x | Window left coordinate. In pixels an relative to the parent window client rectangle. |
y | Window top coordinate. In pixels an relative to the parent window client rectangle. |
width | Window width. In pixels. |
height | Window height. In pixels. |
hwndParent | Parent window handle. |
menuOrID | Menu handle, or child-window identifier. |
If you pass empty string for className parameter, SG Window will register new class and create window with that class. In this case you are responsible for handling all messages for the created window becasue there is no default window procedure. clsWindow class in the sgWindow.vbp example from your SG Window samples folder shows how you can do it.
For more info please refer to CreateWindow function in Win32 API documetation.
Folowing example creates list view control:
Private wnd As SGWindow.Window Sub Form_OnLoad() set wnd = New SGWindow.Window wnd.Create "SysListView32", "", _ ws_CHILD + ws_BORDER + ws_VISIBLE, _ 0, 10, 10, 400, 300, Me.HWND, 1234 End Sub